package RJ;

import java.util.*;

public class Room implements Comparable{
	HashSet<Room> CloseTo;
	RoomSize roomSize;
	String name;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Room(String r) {
		this.name= r;
		CloseTo = new HashSet<Room>();
	}

	public RoomSize getRoomSize() {
		return roomSize;
	}

	public void setRoomSize(RoomSize roomSize) {
		this.roomSize = roomSize;
	}

	@Override
	public int compareTo(Object o) {
		Room room = (Room) o;
		return (this.name.compareTo(room.name));
	}
	@Override
	public String toString(){
		String s = "";
		s += String.format("room(%s)\n", this.getName());
		s += String.format(this.roomSize.toString().substring(0, this.roomSize.toString().length()-4).toLowerCase().concat("-room")+ "(%s)\n", this.getName());
		String t = "";
		for(Room r: CloseTo)	t += r.getName()+", ";
		if(t.length()>0)	t = t.substring(0,t.length() - 2);
		s += String.format("close(%s, {%s})\n", this.getName(),t);
		return s;
	}
}
